import axios from '../axios'

/* 
 * 汽车配件信息管理模块
 */

// 保存
export const save = (data) => {
    return axios({
        url: '/carinfo/save',
        method: 'post',
        data
    })
}

// 更新
export const update = (data) => {
    return axios({
        url: '/carinfo/update',
        method: 'post',
        data
    })
}
// 删除
export const batchDelete = (data) => {
    return axios({
        url: '/carinfo/del',
        method: 'post',
        data
    })
}

// 分页
export const findPage = (params) => {
    console.log(params);
    console.log("http.modules.findPage")
    return axios({
        url: '/carinfo/findPage',
        method: 'get',
        params
    })
}

// 分页
export const groupCategory = () => {
    console.log("http.modules.groupCategory")
    return axios({
        url: '/carinfo/group/category',
        method: 'get',
    })
}

// 分页
export const groupManufacturer = () => {
    console.log("http.modules.groupManufacturer")
    return axios({
        url: '/carinfo/group/manufacturer',
        method: 'get',
    })
}

// 查询全部汽车配件信息
export const findAll = () => {
    console.log("http.modules.findAll")
    return axios({
        url: '/carinfo/findPage?pageNum=1&pageSize=10',
        // url: '/carinfo/search/findall',
        method: 'get'
    })
}
// 查询角色菜单集合
export const findRoleMenus = (params) => {
    return axios({
        url: '/role/findRoleMenus',
        method: 'get',
        params
    })
}
// 保存角色菜单集合
export const saveRoleMenus = (data) => {
    return axios({
        url: '/role/saveRoleMenus',
        method: 'post',
        data
    })
}